﻿using LApi.Web.ViewModel;
using Layans.Data;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using LApi.Web.Controllers;

namespace Api.Web.Controllers
{
    public class Default1Controller : ApiController
    {
        private readonly IList<ApiComment> Api = new List<ApiComment>();


        [HttpGet]
        [ActionName("allapicomment")]
        public IEnumerable<ApiComment> GetApiComment()
        {
            return Api;
        }
        [HttpGet]
        [ActionName("getbyid")]
        public ApiComment GetId(int id)
        {
            return Api[id];
        }
        [HttpPost]
        [ActionName("postapicomment")]
        public void Post([FromBody]ApiComment Value)
        {
            Api.Add(Value);
        }

        public void Put(int id, [FromBody]ApiComment value)
        {
            Api[id] = value;
        }

        public void Delete(int id)
        {
            Api.RemoveAt(id);
        }

    }
}
